# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dvcs-ripper
pkgver=54.2c1bbc6
pkgrel=5
groups=('blackarch' 'blackarch-scanner')
pkgdesc='Rip web accessible (distributed) version control systems: SVN/GIT/BZR/CVS/HG.'
arch=('any')
url='https://github.com/kost/dvcs-ripper'
license=('GPL2')
depends=('perl' 'perl-lwp-protocol-https' 'perl-io-socket-ssl' 'perl-getopt-long')
optdepends=('git: GIT rip support'
            'perl-parallel-forkmanager: faster GIT support'
            'bzr: Bazaar rip support'
            'subversion: SVN rip support'
            'perl-dbd-sqlite: newer SVN support'
            'perl-dbi: newer SVN support'
            'mercurial: Mercurial rip support'
            'cvs: CVS rip support')
makedepends=('git')
source=("git+https://github.com/kost/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -Dm 755 rip-git.pl "$pkgdir/usr/bin/rip-git"
  install -Dm 755 rip-svn.pl "$pkgdir/usr/bin/rip-svn"
  install -Dm 755 rip-cvs.pl "$pkgdir/usr/bin/rip-cvs"
  install -Dm 755 rip-bzr.pl "$pkgdir/usr/bin/rip-bzr"
  install -Dm 755 rip-hg.pl "$pkgdir/usr/bin/rip-hg"
  install -Dm 755 hg-decode.pl "$pkgdir/usr/bin/hg-decode"
  install -Dm 644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

